local skel = fk.CreateSkill {
  name = "emo__yinwu",
}

Fk:loadTranslationTable{
  ["emo__yinwu"] = "引物",
  [":emo__yinwu"] = "每回合限一次，当一张实体基本牌或普通锦囊牌结算结束后，若此牌没有造成伤害且与所有的“魔物”牌的花色均不同，你可以将其置于你的武将牌上，称为“魔物”。",

  ["yinwu_monster"] = "魔物",
  ["#emo__yinwu-invoke"] = "引物：你可以将 %arg 作为“魔物”牌置于武将牌上",
}

skel:addEffect(fk.CardUseFinished, {
  anim_type = "drawcard",
  derived_piles = "yinwu_monster",
  times = function (_, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryTurn)
  end,
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryTurn) == 0 and not data.damageDealt
    and not data.card:isVirtual() and player.room:getCardArea(data.card) == Card.Processing then
      local realCard = Fk:getCardById(data.card.id, true)
      return (realCard.type == Card.TypeBasic or realCard:isCommonTrick()) and
      table.every(player:getPile("yinwu_monster"), function (id)
        return Fk:getCardById(id).suit ~= Fk:getCardById(data.card.id).suit
      end)
    end
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = skel.name, prompt = "#emo__yinwu-invoke:::"..data.card:toLogString()})
  end,
  on_use = function(self, event, target, player, data)
    player:addToPile("yinwu_monster", data.card, true, skel.name)
  end,
})

return skel
